home *** CD-ROM | disk | FTP | other *** search
- on ImportExternalSavedGame
- global gRsrcPath
- if the machineType = 256 then
- set F to FileIO(mnew, "?READ", ".TXT")
- else
- set F to FileIO(mnew, "?READ", "TEXT")
- end if
- if objectp(F) then
- set impotxt to F(mReadFile)
- F(mdispose)
- if not impotxt contains "--- BackPacker 2" then
- abort()
- end if
- set F to FileIO(mnew, "READ", FixPath(gRsrcPath & "BP2SAVED\INDEX.IIF"))
- if objectp(F) then
- set IndexText to F(mReadFile)
- F(mdispose)
- set SGL to value(line 2 of IndexText)
- if count(SGL) > 0 then
- set Index to integer(char 3 to 8 of getAt(SGL, count(SGL))) + 1
- else
- set Index to 1
- end if
- set fileName to "SG" & FixFileIndex(Index) & ".BPD"
- set F to FileIO(mnew, "WRITE", FixPath(gRsrcPath & "BP2SAVED\" & fileName))
- if objectp(F) then
- set err to F(mWriteString, impotxt)
- F(mdispose)
- if err then
- alert(line 2 of field "MenuErrorMessages")
- end if
- end if
- end if
- end if
- end
-